package com.huse.pigservice.controller;


import com.huse.commonutls.ApiResult;
import com.huse.pigservice.entity.Piggery;
import com.huse.pigservice.service.PiggeryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 记录猪舍编号信息的表 前端控制器
 * </p>
 *
 * @author xinxin
 * @since 2021-05-28
 */
@RestController
@RequestMapping("/pigservice/piggery")
@CrossOrigin("*")
public class PiggeryController {
    @Autowired
    private PiggeryService piggeryService;

    @GetMapping("/piggeryTree")
    public ApiResult piggeryTree(){
        return ApiResult.ok().data("piggeryTree",
                piggeryService.piggeryTree());
    }
}

